home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / C / ASAP / dtobject.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-09-08  |  7.7 KB  |  183 lines

  1. /*****************************************************************************
  2.  *                                                                           *
  3.  * ASAP - Amiga Software Authoring Platform                                  *
  4.  *                                                                           *
  5.  * Written by Laurie Perrin                                                  *
  6.  *                                                                           *
  7.  * ADTObject wrapper class                                                   *
  8.  *                                                                           *
  9.  *****************************************************************************/
  10.  
  11. #ifndef ASAP_DTObject_H
  12. #define ASAP_DTObject_H
  13.  
  14. #include <New.h>
  15.  
  16. extern "C"
  17. {
  18.  #include <Proto/DataTypes.H>
  19. }
  20.  
  21. class ADTObject : public _Object
  22. {
  23.  public:
  24.  inline void DisposeDTObject();
  25.  inline void operator delete(void *o);
  26.  inline ULONG DoAsyncLayout(gpLayout *gpl);
  27.  inline ULONG DoDTMethod(Window *win/*, Requester *req*/, unsigned long data = TAG_DONE, ...);
  28.  inline ULONG DoDTMethod(Window *win, Requester *req, unsigned long data = TAG_DONE, ...);
  29.  inline ULONG DoDTMethodA(Window *win/*, Requester *req*/, Msg msg);
  30.  inline ULONG DoDTMethodA(Window *win, Requester *req, Msg msg);
  31.  inline ULONG GetDTAttrsA(TagItem *attrs);
  32.  inline ULONG GetDTAttrs(Tag Tag1, ...);
  33.  inline ULONG *GetDTMethods();
  34.  inline static STRPTR GetDTString(unsigned long id);
  35.  inline DTMethods * GetDTTriggerMethods();
  36.  inline static ADTObject *NewDTObjectA( const char * name, TagItem *attrs);
  37.  inline void * operator new(size_t, const char * name, TagItem *attrs);
  38.  inline static ADTObject *NewDTObject(const char *name, Tag Tag1 = TAG_DONE, ...);
  39.  inline void * operator new(size_t, const char *name, Tag Tag1 = TAG_DONE, ...);
  40.  inline ULONG PrintDTObject(Window *win/*, Requester *req*/, unsigned long data = TAG_DONE, ...);
  41.  inline ULONG PrintDTObject(Window *win, Requester *req, unsigned long data = TAG_DONE, ...);
  42.  inline ULONG PrintDTObjectA(Window *win/*, Requester *req*/, dtPrint *msg);
  43.  inline ULONG PrintDTObjectA(Window *win, Requester *req, dtPrint *msg);
  44.  inline void RefreshDTObjectA(Window *win/*, Requester *req*/, TagItem *attrs);
  45.  inline void RefreshDTObjects(Window *win/*, Requester *req*/, Tag Tag1 = TAG_DONE, ...);
  46.  inline ULONG SetDTAttrsA(Window *win/*, Requester *req*/, TagItem *attrs);
  47.  inline ULONG SetDTAttrsA(Window *win, Requester *req, TagItem *attrs);
  48.  inline ULONG SetDTAttrs(Window *win/*, Requester *req*/, Tag Tag1, ...);
  49.  inline ULONG SetDTAttrs(Window *win, Requester *req, Tag Tag1, ...);
  50. };
  51. //-----------------------------------------------------------------------------
  52. void ADTObject::DisposeDTObject()
  53. {
  54.  ::DisposeDTObject((Object *) this);
  55. }
  56. //-----------------------------------------------------------------------------
  57. void ADTObject::operator delete (void *o)
  58. {
  59.  ((ADTObject *) o)->DisposeDTObject();
  60. }
  61. //-----------------------------------------------------------------------------
  62. ULONG ADTObject::DoAsyncLayout (gpLayout *gpl )
  63. {
  64.  return ::DoAsyncLayout((Object *) this, gpl);
  65. }
  66. //-----------------------------------------------------------------------------
  67. ULONG ADTObject::DoDTMethod (Window *win/*, Requester *req*/, unsigned long data, ...)
  68. {
  69.  return ::DoDTMethodA((Object *) this, win, NULL, (Msg) &data);
  70. }
  71. //-----------------------------------------------------------------------------
  72. ULONG ADTObject::DoDTMethod (Window *win, Requester *req, unsigned long data, ...)
  73. {
  74.  return ::DoDTMethodA((Object *) this, win, req, (Msg) &data);
  75. }
  76. //-----------------------------------------------------------------------------
  77. ULONG ADTObject::DoDTMethodA (Window *win/*, Requester *req*/, Msg msg)
  78. {
  79.  return ::DoDTMethodA((Object *) this, win, NULL, msg);
  80. }
  81. //-----------------------------------------------------------------------------
  82. ULONG ADTObject::DoDTMethodA (Window *win, Requester *req, Msg msg)
  83. {
  84.  return ::DoDTMethodA((Object *) this, win, req, msg);
  85. }
  86. //-----------------------------------------------------------------------------
  87. ULONG ADTObject::GetDTAttrsA (TagItem *attrs)
  88. {
  89.  return ::GetDTAttrsA((Object *) this, attrs);
  90. }
  91. //-----------------------------------------------------------------------------
  92. ULONG ADTObject::GetDTAttrs (Tag Tag1, ...)
  93. {
  94.  return ::GetDTAttrsA((Object *) this, (TagItem *) &Tag1);
  95. }
  96. //-----------------------------------------------------------------------------
  97. ULONG * ADTObject::GetDTMethods ()
  98. {
  99.  return ::GetDTMethods((Object *) this);
  100. }
  101. //-----------------------------------------------------------------------------
  102. STRPTR ADTObject::GetDTString (unsigned long id)
  103. {
  104.  return ::GetDTString(id);
  105. }
  106. //-----------------------------------------------------------------------------
  107. DTMethods * ADTObject::GetDTTriggerMethods ()
  108. {
  109.  return ::GetDTTriggerMethods((Object *) this);
  110. }
  111. //-----------------------------------------------------------------------------
  112. ADTObject * ADTObject::NewDTObjectA (const char * name, TagItem *attrs)
  113. {
  114.  return (ADTObject *) ::NewDTObjectA((APTR) name, attrs);
  115. }
  116. //-----------------------------------------------------------------------------
  117. void * ADTObject::operator new (size_t, const char * name, TagItem *attrs)
  118. {
  119.  return ADTObject::NewDTObjectA(name, attrs);
  120. }
  121. //-----------------------------------------------------------------------------
  122. ADTObject * ADTObject::NewDTObject (const char *name, Tag Tag1, ...)
  123. {
  124.  return NewDTObjectA(name, (TagItem *) &Tag1);
  125. }
  126. //-----------------------------------------------------------------------------
  127. void * ADTObject::operator new (size_t, const char *name, Tag Tag1, ...)
  128. {
  129.  return ADTObject::NewDTObjectA(name, (TagItem *) &Tag1);
  130. }
  131. //-----------------------------------------------------------------------------
  132. ULONG ADTObject::PrintDTObject (Window *win/*, Requester *req*/, unsigned long data, ... )
  133. {
  134.  return PrintDTObjectA(win, NULL, (dtPrint *) &data);
  135. }
  136. //-----------------------------------------------------------------------------
  137. ULONG ADTObject::PrintDTObject (Window *win, Requester *req, unsigned long data, ...)
  138. {
  139.  return ::PrintDTObjectA((Object *) this, win, req, (dtPrint *) &data);
  140. }
  141. //-----------------------------------------------------------------------------
  142. ULONG ADTObject::PrintDTObjectA (Window *win/*, Requester *req*/, dtPrint *msg)
  143. {
  144.  return PrintDTObjectA(win, NULL, msg);
  145. }
  146. //-----------------------------------------------------------------------------
  147. ULONG ADTObject::PrintDTObjectA (Window *win, Requester *req, dtPrint *msg)
  148. {
  149.  return ::PrintDTObjectA((Object *) this, win, req, msg);
  150. }
  151. //-----------------------------------------------------------------------------
  152. void ADTObject::RefreshDTObjectA (Window *win/*, Requester *req*/, TagItem *attrs)
  153. {
  154.  ::RefreshDTObjectA((Object *) this, win, NULL, attrs);
  155. }
  156. //-----------------------------------------------------------------------------
  157. void ADTObject::RefreshDTObjects (Window *win/*, Requester *req*/, Tag Tag1, ...)
  158. {
  159.  RefreshDTObjectA(win, (TagItem *) &Tag1);
  160. }
  161. //-----------------------------------------------------------------------------
  162. ULONG ADTObject::SetDTAttrsA (Window *win/*, Requester *req*/, TagItem *attrs)
  163. {
  164.  return ::SetDTAttrsA((Object *) this, win, NULL, attrs);
  165. }
  166. //-----------------------------------------------------------------------------
  167. ULONG ADTObject::SetDTAttrsA (Window *win, Requester *req, TagItem *attrs)
  168. {
  169.  return ::SetDTAttrsA((Object *) this, win, req, attrs);
  170. }
  171. //-----------------------------------------------------------------------------
  172. ULONG ADTObject::SetDTAttrs (Window *win/*, Requester *req*/, Tag Tag1, ...)
  173. {
  174.  return SetDTAttrsA(win, (TagItem *) &Tag1);
  175. }
  176. //-----------------------------------------------------------------------------
  177. ULONG ADTObject::SetDTAttrs (Window *win, Requester *req, Tag Tag1, ...)
  178. {
  179.  return SetDTAttrsA(win, req, (TagItem *) &Tag1);
  180. }
  181.  
  182. #endif
  183.